#ifndef __INDEX_BUFFER_H__
#define __INDEX_BUFFER_H__

#pragma once

#include "HardwareBuffer.h"

namespace Nezha
{

	class NEZHA_ENGINE_ENTRY IndexBuffer : public HardwareBuffer
	{
	public:
		enum IndexType
		{
			IT_16BIT = 0,
			IT_32BIT,

			IT_NUM
		};

		virtual ~IndexBuffer();

		u32 getNumIndices() const
		{
			return mNumIndices;
		}

		IndexType getIndexType() const
		{
			return mIndexType;
		}

		u32 getStride() const
		{
			return msIndexTypeSize[mIndexType];
		}

		static const u16 msIndexTypeSize[IT_NUM];
	protected:
		IndexBuffer(HardwareBuffer::Usage usage, IndexType it, u32 numIndices, bool createShadowBuffer);

		u32 mNumIndices;
		IndexType mIndexType;
	};

	typedef RefCountedPtr<IndexBuffer>::Default IndexBufferPtr;

}//end namespace Nezha

#endif //end __INDEX_BUFFER_H__